<div>
    <div class="row">
        <div class="col-lg-12">
            <div class="ibox ">
                <div class="ibox-title">
                    <h5>
                        <vc:i18n name="查询条件"></vc:i18n>
                    </h5>
                    <div class="ibox-tools" style="top:10px;">
                        <!-- <button type="button" class="btn btn-link btn-sm" style="margin-right:10px;" v-on:click="_moreCondition()">
                            {{lockPersonManageInfo.moreCondition == true?'隐藏':'更多'}}
                        </button> -->
                    </div>
                </div>
                <div class="ibox-content">
                    <div class="row">
                        <div class="col-sm-2">
                            <div class="form-group input-group">
                                <input type="text" :placeholder="vc.i18n('请选择业主','lockPersonManage')"
                                    v-model="lockPersonManageInfo.conditions.name" class=" form-control">
                                <div class="input-group-prepend">
                                    <button type="button" class="btn btn-primary btn-sm" v-on:click="_openChooseOwner()">
                                        <i class="fa fa-search"></i>
                                        <vc:i18n name="选择" namespace="lockPersonManage"></vc:i18n>
                                    </button>
                                </div>
                            </div>
                        </div>
                        <div class="col-sm-2">
                            <div class="form-group">
                                <input type="text" :placeholder="vc.i18n('请选择时间（在有效期内）','lockPersonManage')"
                                    v-model="lockPersonManageInfo.conditions.queryTime" class="form-control queryTime">
                            </div>
                        </div>
                        <div class="col-sm-2">
                            <div class="form-group">
                                <select class="custom-select" v-model="lockPersonManageInfo.conditions.state">
                                    <option selected disabled value="">{{vc.i18n('请选择授权状态','lockPersonManage')}}</option>
                                    <option value="1001">{{vc.i18n('可用','lockPersonManage')}}</option>
                                    <option value="2002">{{vc.i18n('冻结','lockPersonManage')}}</option>
                                </select>
                            </div>
                        </div>
                        <div class="col-sm-2" >
                            <div class="form-group">
                                <select class="custom-select" v-model="lockPersonManageInfo.conditions.openModel">
                                    <option selected disabled value="">{{vc.i18n('请选择开锁方式','lockPersonManage')}}</option>
                                    <option value="1001">{{vc.i18n('密码开锁','lockPersonManage')}}</option>
                                    <option value="2002">{{vc.i18n('蓝牙开锁','lockPersonManage')}}</option>
                                </select>
                            </div>
                        </div>
                        <div class="col-sm-2" >
                            <div class="form-group">
                                <input type="text" :placeholder="vc.i18n('请输入门锁名称','lockPersonManage')"
                                    v-model="lockPersonManageInfo.conditions.machineName" class=" form-control">
                            </div>
                        </div>
                        <div class="col-sm-2">
                            <button type="button" class="btn btn-primary btn-sm" v-on:click="_queryLockPersonMethod()">
                                <vc:i18n name="查询" namespace="lockPersonManage"></vc:i18n>
                            </button>
                            <button type="button" class="btn btn-primary btn-sm" v-on:click="_resetLockPersonMethod()">
                                <vc:i18n name="重置" namespace="lockPersonManage"></vc:i18n>
                            </button>
                        </div>
                    </div>
                    <div class="row">
                        <div class="col-sm-2" >
                            <div class="form-group">
                                <input type="text" :placeholder="vc.i18n('请输入门锁编号','lockPersonManage')"
                                    v-model="lockPersonManageInfo.conditions.machineCode" class=" form-control">
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>
    <div class="row">
        <div class="col-lg-12">
            <div class="ibox">
                <div class="ibox-title">
                    <h5>
                        <vc:i18n name="门锁授权" namespace="lockPersonManage"></vc:i18n>
                    </h5>
                    <div class="ibox-tools" style="top:10px;">
                        <button type="button" class="btn btn-primary btn-sm" v-on:click="_openAddLockPersonModal()">
                            <vc:i18n name="授权" namespace="lockPersonManage"></vc:i18n>
                        </button>
                    </div>
                </div>
                <div class="ibox-content">
                    <table class="footable table table-stripped toggle-arrow-tiny" data-page-size="15">
                        <thead>
                            <tr>
                                <th class="text-center">
                                    <vc:i18n name='授权编号' namespace='lockPersonManage'></vc:i18n>
                                </th>
                                <th class="text-center">
                                    <vc:i18n name='门锁名称' namespace='lockPersonManage'></vc:i18n>
                                </th>
                                <th class="text-center">
                                    <vc:i18n name='门锁编码' namespace='lockPersonManage'></vc:i18n>
                                </th>
                                <th class="text-center">
                                    <vc:i18n name='业主名称' namespace='lockPersonManage'></vc:i18n>
                                </th>
                                <th class="text-center">
                                    <vc:i18n name='开锁方式' namespace='lockPersonManage'></vc:i18n>
                                </th>
                                <th class="text-center">
                                    <vc:i18n name='授权状态' namespace='lockPersonManage'></vc:i18n>
                                </th>
                                <th class="text-center">
                                    <vc:i18n name='授权开始时间' namespace='lockPersonManage'></vc:i18n>
                                </th>
                                <th class="text-center">
                                    <vc:i18n name='授权结束时间' namespace='lockPersonManage'></vc:i18n>
                                </th>
                                <th class="text-center">
                                    <vc:i18n name='创建时间' namespace='lockPersonManage'></vc:i18n>
                                </th>
                                <th class="text-center">
                                    <vc:i18n name='操作'></vc:i18n>
                                </th>
                            </tr>
                        </thead>
                        <tbody>
                            <tr v-for="lockPerson in lockPersonManageInfo.lockPersons">
                                <td class="text-center">{{lockPerson.lpId}}</td>
                                <td class="text-center">{{lockPerson.machineName}}</td>
                                <td class="text-center">{{lockPerson.machineCode}}</td>
                                <td class="text-center">{{lockPerson.name}}</td>
                                <td class="text-center">
                                    <label v-if="lockPerson.openModel === '1001'">
                                        {{vc.i18n('密码开锁','lockPersonManage')}}
                                    </label>
                                    <label v-if="lockPerson.openModel === '2002'">
                                        {{vc.i18n('蓝牙开锁','lockPersonManage')}}
                                    </label>
                                </td>
                                <td class="text-center">
                                    <label v-if="lockPerson.state === '1001'">
                                        {{vc.i18n('可用','lockPersonManage')}}
                                        (<a href="javascript:void(0)" @click="_switchState(lockPerson)">冻结</a>)
                                    </label>
                                    <label v-if="lockPerson.state === '2002'">
                                        {{vc.i18n('冻结','lockPersonManage')}}
                                        (<a href="javascript:void(0)" @click="_switchState(lockPerson)">解冻</a>)
                                    </label>
                                </td>
                                <td class="text-center">{{lockPerson.startTime}}</td>
                                <td class="text-center">{{lockPerson.endTime}}</td>
                                <td class="text-center">{{lockPerson.createTime}}</td>
                                <td class="text-center">
                                    <div class="btn-group">
                                        <button class="btn-white btn btn-xs" v-on:click="_openRenewalLockPersonModel(lockPerson)">
                                            <vc:i18n name='续期'></vc:i18n>
                                        </button>
                                    </div>
                                    <div class="btn-group">
                                        <button class="btn-white btn btn-xs" v-on:click="_resetLockPwd(lockPerson)">
                                            <vc:i18n name='重置密码'></vc:i18n>
                                        </button>
                                    </div>
                                    <div class="btn-group">
                                        <button class="btn-white btn btn-xs" v-on:click="_openDeleteLockPersonModel(lockPerson)">
                                            <vc:i18n name='删除'></vc:i18n>
                                        </button>
                                    </div>
                                </td>
                            </tr>
                        </tbody>
                        <tfoot>
                            <tr>
                                <td colspan="10">
                                    <ul class="pagination float-right"></ul>
                                </td>
                            </tr>
                        </tfoot>
                    </table>
                    <!-- 分页 -->
                    <vc:create path="frame/pagination"></vc:create>
                </div>
            </div>
        </div>
    </div>

    <vc:create path="lock/deleteLockPerson"></vc:create>
    <vc:create path="lock/resetLockPwd"></vc:create>
    <vc:create path="lock/renewalLockPerson"></vc:create>
    <vc:create path="property/searchOwner" emitChooseOwner="lockPersonManage" emitLoadData="lockPersonManage"></vc:create>

</div>
